package com.praxinfosystems.sarthak.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.praxinfosystems.sarthak.dao.UserDao;
import com.praxinfosystems.sarthak.domain.User;

@Service("userService")
public class UserServiceImpl implements UserService{

	@Resource(name="userRepository")
	private UserDao userDao;
	
	@Override
	public  User getUserByUserId(String userId) {
		System.out.println("reached in service");
		User autheticatedUser=userDao.getUserDetail(userId);
		return autheticatedUser;
	}

	@Override
	public boolean checkUserAvailability(String userId) {
		boolean isAvailable =true;
		User user=userDao.getUserDetail(userId);
		if(null!=user){
			isAvailable=false;
		}
		return isAvailable;
	}
	

}
